#include <stdio.h>

//
//snprintf对于overlap的情况，看man snprintf,标准对于这种情况规定结果是未知的!
//
int main(int argc, char **argv)
{
    char buf[100] = { 0 };
    snprintf(buf, sizeof(buf), " this is %s oacean", "hello");
    printf("%s\n", buf);

    //on deiban output: after that 
    //on rhel5 output: after that 
    //on aix output: this is hello oacean after that
    snprintf(buf, sizeof(buf), "%s after that ", buf);
    printf("%s\n", buf); 

	return 0;
}
